package com.itheima.pinda.entity.base;


import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 基础实体
 *
 * @author llhuang10
 * @date 2021/9/4 22:33
 */
@Getter
@Setter
@Accessors(chain = true)
@ToString(callSuper = true)
public class Entity extends SuperEntity {

    public static final String UPDATE_TIME = "updateTime";
    public static final String UPDATE_USER = "updateUser";
    public static final String CREATE_TIME = "createTime";
    public static final String CREATE_USER = "createUser";
    private static final long serialVersionUID = 8284072919717334649L;

    @ApiModelProperty(value = "最后修改时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    protected LocalDateTime updateTime;

    @ApiModelProperty(value = "最后修改人ID")
    @TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE)
    protected Long updateUser;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    protected LocalDateTime createTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField(value = "create_user", fill = FieldFill.INSERT)
    protected Long createUser;

    public Entity(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser) {
        super(id);
        this.createUser = createUser;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
    }

    public Entity() {
    }

}